CreateTextToUnicodeInfo
Creates and returns a Unicode converter object containing information required for converting strings from a non-Unicode encoding to Unicode.
pascal OSStatus CreateTextToUnicodeInfo ( ConstUnicodeMappingPtr iUnicodeMapping, TextToUnicodeInfo *oTextToUnicodeInfo);
iUnicodeMapping
- A pointer to a structure of type
UnicodeMapping
(page 118). Your application provides this structure to identify the mapping to be used for the conversion. TheunicodeEncoding
field of this structure can specify a Unicode format ofkUnicode16BitFormat
orkUnicodeUTF8Format
. Versions of the Unicode Converter prior to 1.2.1 do not supportkUnicodeUTF8Format
.oTextToUnicodeInfo
- A pointer to a Unicode converter object of type
TextToUnicodeInfo
(page 119), used for converting text to Unicode. On output, the parameter returns a Unicode converter object that holds mapping table information you supply as theUnicodeMapping
parameter and state information related to the conversion. This information is required for conversion of a text stream in a non-Unicode encoding to Unicode.- function result
- A result code. See "Text Encoding Conversion Manager Result Codes" (page 42) in the chapter "Basic Text Types Reference."
DISCUSSION
You pass a Unicode converter object returned from the functionCreateTextToUnicodeInfo
to the functionConvertFromTextToUnicode
(page 129) orConvertFromPStringToUnicode
(page 163) to identify the information to be used for the conversion. These two functions modify the contents of the object.You pass a Unicode converter object returned from
CreateTextToUnicodeInfo
to the functionTruncateForTextToUnicode
(page 160) to identify the information to be used to truncate the string. This function does not modify the contents of the Unicode converter object.In addition to various resource and memory errors that it can return, the function can return the following result codes:
If an error is returned, the Unicode converter object is invalid
kTextUnsupportedEncodingErr
One of the encodings specified by the Unicode mapping structure you supply is not currently supported.kTECMissingTableErr
A resource associated with one of the encodings is missing.kTECTableChecksumErr
A resource has an invalid checksum, indicating that it has become corrupted.
SEE ALSO
CreateTextToUnicodeInfoByEncoding
(page 127)